﻿using System.Windows;
using System.Windows.Controls;

namespace Obvestila
{
  /// <summary>
  /// Interaction logic for FancyPopup.xaml
  /// </summary>
  /// 

  public partial class FancyPopup : UserControl
  {

    #region Procesna stevilka v obdelavi

      /// <summary>
      /// Description
      /// </summary>
      public static readonly DependencyProperty ProcStProperty =
          DependencyProperty.Register("ProcSt",
                                      typeof(string),
                                      typeof(FancyPopup),
                                      new FrameworkPropertyMetadata(""));

      /// <summary>
      /// A property wrapper for the <see cref="BalloonTextProperty"/>
      /// dependency property:<br/>
      /// Description
      /// </summary>
      public string ProcSt
      {
          get { return (string)GetValue(ProcStProperty); }
          set { SetValue(ProcStProperty, value); }
      }

      #endregion

    #region ClickCount dependency property

    /// <summary>
    /// The number of clicks on the popup button.
    /// </summary>
    public static readonly DependencyProperty ClickCountProperty =
        DependencyProperty.Register("ClickCount",
                                    typeof (int),
                                    typeof (FancyPopup),
                                    new FrameworkPropertyMetadata(0));

    /// <summary>
    /// A property wrapper for the <see cref="ClickCountProperty"/>
    /// dependency property:<br/>
    /// The number of clicks on the popup button.
    /// </summary>
    public int ClickCount
    {
      get { return (int) GetValue(ClickCountProperty); }
      set { SetValue(ClickCountProperty, value); }
    }

    #endregion

    public FancyPopup()
    {
      InitializeComponent();
    }

    private void OnButtonClick(object sender, RoutedEventArgs e)
    {
      //just increment a counter - will be displayed on screen
      ClickCount++;
        
    }

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        ClickCount--;
        foreach (Window window in Application.Current.Windows)
        {

                window.Close();
                break;

        }  
    }

  }
}